home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 37
/
Aminet 37 (2000)(Schatztruhe)[!][Jun 2000].iso
/
Aminet
/
dev
/
basic
/
Mildred.lha
/
lha
/
ZoomDemo.lha
/
ZoomTest2.ascii
< prev
next >
Wrap
Text File
|
1999-03-27
|
3KB
|
94 lines
WBStartup
NoCli
DEFTYPE.l
.initgraphics
MBitmap 0,320,240
MBitmap 1,320,240
Mc2pWindow 0,320,240 ; Setup structures for c2p conversions.
InitBank 0,320*240,$10002 ; Get some free CHIP memory.
CludgeBitMap 0,320,240,8,Bank(0) ; And make it a planar bitmap.
LoadBitMap 0,"ZoomPic7.IFF",0 ; Get a pic
MPlanar16ToBitmap 0,Bank(0) ; Make it chunky
Dim scrtaglst.TagItem(7) ; All this stuff sets up our
scrtaglst(0)\ti_Tag = #SA_Left ; Taglist for the screen we
scrtaglst(0)\ti_Data = 0 ; want. As you can see, it's
scrtaglst(1)\ti_Tag = #SA_Depth ; rather non-standard.
scrtaglst(1)\ti_Data = 8 ; it doesn't have to be, it's
scrtaglst(2)\ti_Tag = #SA_Width ; just that this routine needs
scrtaglst(2)\ti_Data = 320 ; a larger screen to avoid
scrtaglst(3)\ti_Tag = #SA_Height ; clipping.
scrtaglst(3)\ti_Data = 240
scrtaglst(4)\ti_Tag = #SA_BitMap
scrtaglst(4)\ti_Data = Addr BitMap (0)
scrtaglst(5)\ti_Tag = #SA_ShowTitle
scrtaglst(5)\ti_Data = 0
scrtaglst(6)\ti_Tag = #SA_Draggable
scrtaglst(6)\ti_Data = 0
scrtaglst(7)\ti_Tag = #TAG_END ; The most important tag of them all.
ScreenTags 0,"MildredDEMO",&scrtaglst(0) ; Open our intuition screen.
ShowPalette 0 ; Attach our palette to the screen.
MUseBitmap 1 ; Tell Mildred to use our main
; chunky buffer (just in case)
NEWTYPE.ScaleList
OpWidth.w
DestXOffset.w
SrcXOffset.q
XAddOffset.q
YAddOffset.q
End NEWTYPE
Dim Skale.ScaleList(240)
angrad.q=Pi/180
For y=0 To 239
Skale(y)\OpWidth=y+1
Skale(y)\DestXOffset=0
Skale(y)\SrcXOffset=Sin(y*angrad*3)
Skale(y)\XAddOffset=-0.001
Skale(y)\YAddOffset=0
Next y
mag.q=1
its.l=0
magdirection.q=1.5
SourceX.q=0
SourceY.q=0
OpWidth.w=320
OpHeight.w=240
DestX.w=0
DestY.w=0
ResetTimer
Repeat ; Repeat our mainloop ....
If mag+magdirection>240 OR mag+magdirection<1 Then magdirection=-magdirection
mag+magdirection
SourceXAdder.q=mag/240
SourceYAdder.q=mag/240
MZoom SourceX,SourceY,SourceXAdder,SourceYAdder,DestX,DestY,OpWidth,OpHeight,False,0,&Skale(0)
Mc2p Bank(0) ; Convert our chunky buffer to
its+1
Until Joyb(0)<>0 OR Joyb(1)<>0 OR RawStatus($45)
t=Timer
t=Max(t,1)
its=Max(its,1)
a.q=50.0/(t/its)
WbToScreen 1
Window 2,16,16,400,60,0,"Test results",1,0
WindowOutput 2
NPrint a," frames per second"
NPrint " "
NPrint "Press mouse/joy button..."
VWait 20
Repeat
Until Joyb(0)<>0 OR Joyb(1)<>0 OR RawStatus($45)